package com.whfc.ms.api.md.controller;

import com.whfc.common.base.BaseController;
import com.whfc.common.result.Result;
import com.whfc.common.result.ResultUtil;
import com.whfc.common.util.SessionAttr;
import com.whfc.fuum.entity.SysUser;
import com.whfc.fvs.dto.FvsAnalysisDTO;
import com.whfc.ms.api.md.service.MdFvsBoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author: hw
 * @date: 2021-11-18 16:28
 * @description: 数据大屏 - 视频监控
 */
@RestController
@RequestMapping("/ms/api/md/board/fvs")
public class MdFvsBoardController extends BaseController {

    @Autowired
    private MdFvsBoardService mdFvsBoardService;

    @GetMapping("/analysis")
    public Result fvsAnalysis(@SessionAttribute(SessionAttr.MS_USER) SysUser user,
                              @RequestParam("deptId") Integer deptId) {
        logger.info("大屏-视频统计，loginer:{},deptId:{}", user.getUsername(), deptId);
        FvsAnalysisDTO data = mdFvsBoardService.fvsAnalysis(deptId);
        return ResultUtil.success(data);
    }
}
